/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Pantallas;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Diego
 */
public class ExitoLoginout extends java.awt.Dialog {

    /**
     * Creates new form ExitoLoginout
     */
    public ExitoLoginout(java.awt.Frame parent, boolean modal, String dialogo) {
        super(parent, modal);
        initComponents();
        ExitoLoginout.hilo h = new ExitoLoginout.hilo(this);
        h.start();
        cartel.setText(dialogo);
        this.setVisible(true);


    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        cartel = new javax.swing.JLabel();

        setAutoRequestFocus(false);
        setLocationRelativeTo(this);
        setPreferredSize(new java.awt.Dimension(350, 100));
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                closeDialog(evt);
            }
        });

        cartel.setFont(new java.awt.Font("Simplified Arabic", 0, 24)); // NOI18N
        add(cartel, java.awt.BorderLayout.NORTH);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * Closes the dialog
     */
    private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
        setVisible(false);
        dispose();
    }//GEN-LAST:event_closeDialog

    /**
     * @param args the command line arguments
     */
    class hilo extends Thread {

        int espera = 3;
        ExitoLoginout exito2;

        public hilo(ExitoLoginout exito2) {
            this.exito2 = exito2;
        }

        @Override
        public void run() {

            while (espera > 0) {
                espera--;
                try {
                    ExitoLoginout.hilo.sleep(1000);
                    System.out.println("Espera " + espera);
                } catch (InterruptedException ex) {
                    System.out.println("Esperandooo " + espera);
                }
            }
            exito2.dispose();
        }
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel cartel;
    // End of variables declaration//GEN-END:variables
}
